                                                               
      1BBBBBM.        ,BBBBBBBBBBBM.          iBBBBBBBBBBBBBBBBBU          
     UBU...7BB        BBr.,......;BB         .BB:.:,,.,.,.,.,..FB7         
     7B2    vBP      ZBL         .BB         ,BP               rBF         
      BBr   ,ZB,    :BO.   rBJ.  .BB         .Bq.  ,rirr7r7r7rrOBi         
       BB:   rBB    BBi   ,MBY.  :BB         .BE.  :MBMMOMMMMM8Z:          
       jBj.   FBv  LB2.   UBBv.  ,BB         .BN.  .BBYir;rirr:            
        BBi   :BB  BB:   iBBBY.  :BB         .B0.  iSMOBBBMBMMBBU          
        :BG.   LBUUBL   ,EB7BL.  ,BB         .BN.              MB,         
         ZBL   ,qBB0.   YBL.BY.  ,BB         .BE.              8Bi         
          BB:   ;BBi   :BB .BY.  ,BB         .Bq.  :PMBBBBBBBBBB0          
          7BS.  .Xk.  .kBr :Bj.  ,BB          B0.  ,MBUuU1U1U1v.           
           BBr   r7   7BB  :BL.  :BBUvuJuJUJLuBP.  .GB                     
           .BB,  ,.  :MB.  iBJ   ;NOMBBBBBBBBOBE.  .0B                     
            FBU      YB1   ;Bv                     .ZB.                    
             BB:    :BB    rBj                     .ZB.                    
             :BBBBBBBB:     BBBBBBBBBBBBBBBBBMBBBBBBBN                     
               YS0Pq7        r1EP0PNPNP0q0P0PkobUEq2:            

--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////// LUA VSH Look & Feel /////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------             
///////////////////////////////// v0.3 by LXD //////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------------
///////////////////////////////////Changelog////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
/////////////////////////////////////Added//////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawSymbol()
Draws an original psp Symbol
eg.cross, square, start 

vlf.term()
terminates the vlf engine
and unloads all files used by vlf.

VLF.SetCustomWave()
loads and sets a custom wave

VLF.Font_small, VLF.Font_huge 
you can use these fonts instead of VLF.Font
--------------------------------------------------------------------------------------------------------------------------------
///////////////////////////////////Improved/////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawCentralMenu() 
-added scrolling if to many items are available

-the item table can now be defined like this 
-table = {"item 1","item 2","item 3"}

-SET_HIGHLIGHT_BUTTON is now auto controled

VLF.Draw_Waves()
-Custom Waves can now be displayed [VLF.SetCustomWave()]

VLF.DrawOptions()
its possible to print custom options

VLF.DrawClock()
added an option to adjust the time shift 

VLF.DrawText()
-you can display arrows by using
 VLF_ARROW_UP
 VLF_ARROW_DOWN
 VLF_ARROW_UP_DOWN
 instead of selected 
 E.G
 VLF.DrawText(0,0,VLF.Font,"VLF lib 0.3",2,3,VLF.Text_Color,VLF.Shadow_Color,VLF_ARROW_UP_DOWN,false)


-you can use symbol variables in your text 


--------------------------------------------------------------------------------------------------------------------------------
///////////////////////////////////Bugs/////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
vlf.DrawFrame() 
fixed compability to VLF.DrawTitleBar()

vlf.drawfocus()
fixed animation error

vlf.drawscrollbar()
the text table can now be defined with less than 9 fields
--------------------------------------------------------------------------------------------------------------------------------
*optional///////////////////////////////////////////////functions///////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------

VLF.init(main_file*)
Initates the VLF engine
main_file: the path to the vlf main lib, file containing all the files needed / defaults to "main.vlf"
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.term()
terminates the vlf engine and frees the memory from all files used by vlf
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.SetImageColor(image,color)
changes the color of an image 
(use it to adjust a img to the bg color)
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawTexture(texture,x,y,width*,height*,startx*,starty*,endx*,endy*,rotation*,alpha*)
a texture drawn with this function will be fadet when using VLF.FadeObjects()
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawStatusBar(percent,text,width*,x*,y*)
Draws a Status Bar 
percent: the percentage status of the status bar
text: the current activity 
E.G. "Copying files" , "Loading images"
use x, y to set a position on the screen / defaults to the center position of the screen
use width to set the status bar width / defaults to the original size of the status bar 
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.GetDataFromfile(comp_file,key,keep_key*,pos*)	
Decrypts a Container file and returns the files as a table
comp_file: path to the container file e.g."container.vlf"
key: the key splits the files in the container
keep_key: if you want to keep the key then set to true 
pos: use it if you want to get a special file instead of a table containing all files
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.CompDataTofile(file,table,key*)
use it to compress files to a container.
file: the path where to save the container file
table: the table containing the files to be compressed
e.g. table = {
"ms0:/file1.dat",
"ms0:/file2.dat",
"ms0:/file3.dat"
}
key: the key used to split the files 
use a sequenz of characters not present anywhere else in the files
e.g."//*********KEY**********//" (longer -> better)
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.GetBG(BG*,file*,inc_img)
loads a background from a container file 
and set the variables VLF_WAVE_ALPHA, VLF.Shadow_Color 
BG: use it to load a specific background if no BG is set then the original psp background is loaded (affected by the month) 
file: path to a file containing backgrounds (defaults to "theme.vlf"/ theme.vlf containg 27 backgrounds)

the background is default loadet to VLFBG
e.g.VLFBG:draw(0,0)^

inc_img: if set to true the function will automaticely 
change several images to the bg color  (batterie shadow, textbox etc.)

after loading an background VLF.Shadow_Color and VLF_WAVE_ALPHA will automaticely be set to 
the color the original xmb uses 
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawText(x,y,font,text,distance*,radius*,color*,shadowcolor*,selected*,fade*)
x,y the position on the screen 
use either VLF_CENTER or VLF_RIGHT instead of x to set the align of the text
 
font: the used font, the default is VLF.Font

text: the text as string to draw
      if you want to draw special symbols like the psp cross you can 
      insert those variables in your string 
       VLF_CROSS
       VLF_CIRCLE
       VLF_SQUARE
       VLF_TRIANGLE
       VLF_SELECT
       VLF_START
       VLF_RTRIGGER
       VLF_LTRIGGER
       E.G. text = "Press"..VLF_CROSS.."to enter or"..VLF_TRIANGLE.."to cancel"


distance: the distance of the shadow to the text 
default: 2

radius: the radius of the shadow // if your app is running to slow 
you may have to decrease the radius.

color: the color of the text use VLF.Text_Color as default 

shadowcolor: color of the shadow (default VLF.Shadow_Color) 
use VLF_AUTO_COLOR instead of shadowcolor 
and the lib will calculate a color matching to the background // still beta 

selected: if set to true it will show a focus arround the text 
remember to set VLF_DISABLE_FOCUS_ANIMATION to true if you want to use more than 1 focus
if you want to show an arrow on the text e.g. to adjust the time or s.e
you can set selected to 
 VLF_ARROW_UP
 VLF_ARROW_DOWN
 VLF_ARROW_UP_DOWN


fade: if set to true then fading the text is disabled (VLF.FadeObjects) 
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.UpdateFocus()
Updates the focus alpha 
already called by VLF.DrawFrame
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawFocus(x,y,width,height,alpha*)
Draws a focus 
use this function if you want to set a area on the screen to focus

set the following variables to control the focus
VLF_FOCUS_SPEED
Controls the blinking speed of the focus 
default: 35

VLF_FOCUS_ANIMATION_FRAMES
set it if you want to change the framerate of the focus animation 
maximum = 5 //still a litle buggy 
default: 1

VLF_FOCUS_ALPHA
use it either to get or set the current focus alpha 
default: 0-255

alpha: only use alpha if you dont want to use VLF.UpdateFocus
IMPORTANT: if you want to set more than 1 area to focus you have to set 
VLF_DISABLE_FOCUS_ANIMATION = true 
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawTextBox(name,text,x,y,selected*,width*,height*)
Draws a text Box to the screen 
name: the name of the textbox e.g. username, password
text: the text shown in the textbox
x,y the position on the screen 
selected: set a focus on the textbox
width,height set specific width and height 
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawCentralMenu(table,selected*,font*,align*,spacing*,x*,y*,object_limit*)
Draws a Central menu
table: a table containing the menu items 
can be set in 4 different ways e.g.

option 1:
table = {
"Menu item 1",
"Menu item 2",
"Menu item 3"
}

option 2:
table = {
{"Menu item 1"},
{"Menu item 2"},
{"Menu item 3"}
}

option 3:
or use detailed options for each item 
table = {
	{"Option 1",2,3, VLF.Text_Color, VLF.Shadow_Color},
	{"Option 2",2,3, VLF.Text_Color, VLF.Shadow_Color},
	{"Option 3",2,3, VLF.Text_Color, VLF.Shadow_Color},
	{"Option 4",2,3, VLF.Text_Color, VLF.Shadow_Color}
	}

options 2 and 3 can also be mixed 
table = {
{"Menu item 1"},
{"Menu item 2",2,3, VLF.Text_Color, VLF.Shadow_Color},
{"Menu item 3"}
}


selected: set the item which is highlighted or 
if you want the buttons to be auto controlled by the function use VLF_USE_BUTTONS
the function is returning the item chosen from the menu (by pressing cross)

font: the font used to draw the central menu / default VLF.Font

align: use 
1: Center aligned
2: Left aligned
3: Right aligned 
default align is Center 

spacing: use it to set the distance between the items / default 5

use x,y to set a specific position on the screen
when using the Center align x is the center position of the menu 

obejct_limit: if there are to many items in the table you can set how much are displayed 
	      and enable scrolling by setting object_limit.
	      if object_limit is not set the scrolling is automaticely 
              enabled if more than 9 items in the table.
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawScrollBar(text,act,x*,y*,height*)
text_table: table containing the text data 
E.G. 
table = {
"VLF lib v0.2",
"By LXD"
}

 action should either be 1 or 0 
 1:Scroll Down 
 2:Scroll Up	
 or use VLF_USE_BUTTONS to automaticely control the state 

 
use x,y to set the position on the screen

use height to set the height of the text area /default 140

--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.Draw_Waves(wvy1,wvy2,lag,alpha*,move_y*)
Draws the Waves 
wave_a_y :used to adjust the y position of wave a on the screen
wave_b_y :used to adjust the y position of wave b on the screen

lag: used to set the speed of the waves (lower = faster // min 2)
standart xmb speed = 70

alpha = used to set the opacity of the waves (automaticly set by VLF.GetBG)
 
use move_y to enable y animation (Beta)

already done by using VLF.DrawFrame
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawClock(shift*,x*,y*)
Draws the psp clock 

use shift to adjust the timeshift

x,y set a position on the screen
already drawn by VLF.DrawFrame
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawTitleBar(text,anim*,image*,Color*)
text :the printed Text(Name of your App)

anim : 
1 :slide in 
2 :slide out (returns false if animation is ready)
defaults to 1

image :the Image shown beside the name 
preloaded 
TOP.APP(shows a psp sign, used for installers, configurators),
TOP.UPD(shows the psp update logo),
TOP.EGG(shows an Egg, used for Betas, Demos... ),
TOP.INF(shows a ?)

Color :the Color of the Bar 
if no Color is selected it uses the preloadet Color matching to the BG

--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-------------------------------------------------------------------------------------------------------------------------------- 
VLF.DrawOptions(options,msg1*,msg2*)
Draws dialog options 
1 = Enter 
2 = Cancel 
3 = Enter + Cancel
you can also print your own options by setting msg1 and msg2
msg1 is the X option 
msg2 is the O option
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.FadeObjects(in_out,speed)
if in_out set to 
1: Fade out
2: Fade in 
use one of the this options to set the speed
VLF_FADE_SPEED_SLOW
VLF_FADE_SPEED_STANDARD
VLF_FADE_SPEED_FAST
VLF_FADE_SPEED_VERY_FAST
VLF_FADE_SPEED_SUPER_FAST 

set VLF_MAIN_ALPHA to manuly controle the fade
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawFrame()
Draws the background, wave, Clock.
and updates the focus 
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.DrawSymbol(x,y,symbol,draw_without_shadow*,not_fade*)
x,y: the position on the screen

symbols: the symbol you want to draw
 VLF_CROSS
 VLF_CIRCLE
 VLF_SQUARE
 VLF_TRIANGLE
 VLF_SELECT
 VLF_START
 VLF_RTRIGGER
 VLF_LTRIGGER

draw_without_shadow: if you dont want to draw the shadow of the symbol the set to true // defaults to false

not_fade: set to true if you dont want to the symbol to be fadet when using VLF.FadeObjects() 
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
VLF.SetCustomWave(filepath,key)
loads a custom wave.
there are 3 custom waves included in the dl (blue wave, fire wave, white stripes)
filepath: the filepath to the customwave file

key: use only if want to load a wave packed with a special key

sample is included in the tutorial
--------------------------------------------------------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------------------------------------------------------
(c)LXD